using System;
using System.Collections.Generic;
using System.Text;
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Security.Cryptography;

public class LoaiSanPhamBUS
{
    private LoaiSanPhamDAO objLoaiSanPhamDAO;
    public LoaiSanPhamBUS(string strPath)
    {
        objLoaiSanPhamDAO = new LoaiSanPhamDAO(strPath);
    }
    public DataSet SelectLoaiSanPhamAll()
    {
        DataSet ds;
        try
        {
            ds = objLoaiSanPhamDAO.SelectLoaiSanPhamAll();
            return ds;
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }

    public DataSet SelectTenLoaiSanPham(int id)
    {
        DataSet ds;
        try
        {
            ds = objLoaiSanPhamDAO.SelectTenLoaiSanPham(id);
            return ds;
        }
        catch (System.Exception e)
        {
            throw new Exception(e.Message, e.InnerException);
        }
    }

    public Boolean InsertLoaiSanPham(LoaiSanPhamDTO loaisp)
    {
        try
        {
            return objLoaiSanPhamDAO.InsertLoaiSanPham(loaisp);
        }
        catch (System.Exception e)
        {
            return false;
        }
    }

    public Boolean UpdateLoaiSanPham(LoaiSanPhamDTO loaisp)
    {
        try
        {
            return objLoaiSanPhamDAO.UpdateLoaiSanPham(loaisp);
        }
        catch (System.Exception e)
        {
            return false;
        }
    }

    public Boolean DeleteLoaiSanPham(int id)
    {
        try
        {
            return objLoaiSanPhamDAO.DeleteLoaiSanPham(id);
        }
        catch (System.Exception e)
        {
            return false;
        }
    }

}